<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <h:form id="TipoDocumentoListForm">

        <p:panel header="#{bundle.ListTipoDocumentoTitle}">

            <p:dataTable id="datalist" value="#{tipoDocumentoController.items}" var="item"
                         selectionMode="single" selection="#{tipoDocumentoController.selected}"
                         rowKey="#{item.id}"
                         paginator="true"
                         rows="10"
                         rowsPerPageTemplate="10,20,30"
                         >

                <p:ajax event="rowSelect"   update="createButton viewButton editButton deleteButton"/>
                <p:ajax event="rowUnselect" update="createButton viewButton editButton deleteButton"/>

                <p:column sortBy="#{item.id}" filterBy="#{item.id}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_id}"/>
                    </f:facet>
                    <h:outputText value="#{item.id}"/>
                </p:column>
                <p:column sortBy="#{item.codigo}" filterBy="#{item.codigo}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_codigo}"/>
                    </f:facet>
                    <h:outputText value="#{item.codigo}"/>
                </p:column>
                <p:column sortBy="#{item.descripcion}" filterBy="#{item.descripcion}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_descripcion}"/>
                    </f:facet>
                    <h:outputText value="#{item.descripcion}"/>
                </p:column>
                <p:column sortBy="#{item.aplicaMotorista}" filterBy="#{item.aplicaMotorista}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_aplicaMotorista}"/>
                    </f:facet>
                    <h:outputText value="#{item.aplicaMotorista}"/>
                </p:column>
                <p:column sortBy="#{item.aplicaSocio}" filterBy="#{item.aplicaSocio}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_aplicaSocio}"/>
                    </f:facet>
                    <h:outputText value="#{item.aplicaSocio}"/>
                </p:column>
                <p:column sortBy="#{item.creationDate}" filterBy="#{item.creationDate}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_creationDate}"/>
                    </f:facet>
                    <h:outputText value="#{item.creationDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:outputText>
                </p:column>
                <p:column sortBy="#{item.createdBy}" filterBy="#{item.createdBy}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_createdBy}"/>
                    </f:facet>
                    <h:outputText value="#{item.createdBy}"/>
                </p:column>
                <p:column sortBy="#{item.lastUpdateDate}" filterBy="#{item.lastUpdateDate}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_lastUpdateDate}"/>
                    </f:facet>
                    <h:outputText value="#{item.lastUpdateDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:outputText>
                </p:column>
                <p:column sortBy="#{item.lastUpdateBy}" filterBy="#{item.lastUpdateBy}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListTipoDocumentoTitle_lastUpdateBy}"/>
                    </f:facet>
                    <h:outputText value="#{item.lastUpdateBy}"/>
                </p:column>
                <f:facet name="footer">
                    <p:commandButton id="createButton" icon="ui-icon-plus"   value="#{bundle.Create}" actionListener="#{tipoDocumentoController.prepareCreate}" update=":TipoDocumentoCreateForm" oncomplete="TipoDocumentoCreateDialog.show()"/>
                    <p:commandButton id="viewButton"   icon="ui-icon-search" value="#{bundle.View}" update=":TipoDocumentoViewForm" oncomplete="TipoDocumentoViewDialog.show()" disabled="#{empty tipoDocumentoController.selected}"/>
                    <p:commandButton id="editButton"   icon="ui-icon-pencil" value="#{bundle.Edit}" update=":TipoDocumentoEditForm" oncomplete="TipoDocumentoEditDialog.show()" disabled="#{empty tipoDocumentoController.selected}"/>
                    <p:commandButton id="deleteButton" icon="ui-icon-trash"  value="#{bundle.Delete}" actionListener="#{tipoDocumentoController.delete}" update=":growl,datalist" disabled="#{empty tipoDocumentoController.selected}"/>
                </f:facet>

            </p:dataTable>

        </p:panel>

    </h:form>

</ui:composition>